package edu.protbioinfo;

import java.text.NumberFormat;

import org.apache.commons.lang.StringUtils;

public abstract class Utils {

	public static char[] getCharArrayForIncrementDigit(int from, int to) {
		char[] chars = {};
		if(to > from){
			chars = new char[to - from];			
			for(int i = from; i < to; i++){
				chars[i] = Character.forDigit(i, 10);
			}
		}
		return chars;
	}
	
	public static class Pair<T, S> {
		T first;
		S second;
		
		public Pair(T first, S second) {
			this.first = first;
			this.second = second;
		}
		
		public T first(){
			return this.first;
		}
		
		public S second(){
			return this.second;
		}
		
	}

	public static String format(double num, int fraction) {
		NumberFormat formatter = NumberFormat.getInstance();
		formatter.setMaximumFractionDigits(fraction);
		return formatter.format(num);
	}

}
